package com.hp.gxw.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hp.gxw.entity.CostEquipmentUsagerate;
import com.hp.gxw.mapper.CostEquipmentUsagerateMapper;
import com.hp.gxw.service.ICostEquipmentUsagerateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author huangping
 * @since 2024-01-04
 */
@Service
public class CostEquipmentUsagerateServiceImpl extends ServiceImpl<CostEquipmentUsagerateMapper, CostEquipmentUsagerate> implements ICostEquipmentUsagerateService {

    @Override
    @Transactional
    public void coverUpload(List<CostEquipmentUsagerate> list) {
        remove(new LambdaQueryWrapper<CostEquipmentUsagerate>().eq(CostEquipmentUsagerate::getHappenMonth,list.get(0).getHappenMonth()));
        saveBatch(list);
    }
}
